export class MyCookie {
    public static SetCookie(key:string, value:string, expireTime:number){
        let expireDate = new Date(new Date().getTime() + expireTime).toString();
        document.cookie = key+"="+value+"; expires="+expireDate;
    }

    public static GetCookie(key:string):string{
        let reg1 = new RegExp(key+"=(.+?);");
        let reg2 = new RegExp(key+"=(.+?)$");
        let execGroup1 = reg1.exec(document.cookie);
        let execGroup2 = reg2.exec(document.cookie);
        if(execGroup1 != null){
            return execGroup1[1]; 
        } else if(execGroup2 != null){
            return execGroup2[1]; 
        } else{return "NotFind"}
    }
}